<%@ page language="java" pageEncoding="UTF-8"%>
<%@ page language="java" import="java.util.*"%>
<%@page import="com.tjsinfo.tjsoa.meetingroom.vo.MeetingRoomEmploy"%>
<%@page import="com.tjsinfo.tjsoa.meetingroom.vo.MeetingRoomMain"%>
<%@page import="java.text.SimpleDateFormat"%>
<%@page import="com.tjsinfo.tjsoa.system.vo.User"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
	MeetingRoomEmploy infos =(MeetingRoomEmploy)request.getAttribute("roomEmpoly");
	List roomList=(List)request.getAttribute("roomList");
	String strName=(String)request.getAttribute("strName");
	SimpleDateFormat sdf = new SimpleDateFormat("HH:mm");
	SimpleDateFormat sdf1 = new SimpleDateFormat("yyyy-MM-dd HH:mm");
	String treePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+"/Tree/";
	User user = (User) session.getAttribute("user");
%>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
	<head>
	<base href="<%=basePath%>" />
	<title>天津市粮油集团有限公司</title>
	<style type="text/css">

	td {
	font:12px/170% "宋体", "新宋体", "黑体"; color:#000
}
		th {
	font:12px/170% "宋体", "新宋体", "黑体"; color:#000
}
.black_overlays{
			display: none;
			position: absolute;
			top: 0%;
			left: 0%;
			width: 1200px;
			height: 800px;
			background-color: gray;
			z-index:1001;
			-moz-opacity: 0.8;
			opacity:.80;
			filter: alpha(opacity=80);

}

/* 添加任务div样式 */
.ceshi5 {
			    display: none;
				position: absolute;
				top: 25%;
				left: 30%;
				width: 253px;
				height: 235px;
				border: 1px solid #11557B;
				border-bottom: block;
				background-color: #E2F7FF;
				z-index: 1003;
				overflow: auto;
}
  </style>
	<link href="<%=basePath%>style/txlz7.css" rel="stylesheet" type="text/css" />
		<!-- 多系统树 开始 -->
	<link href="<%=basePath %>ajaxFramework/ext-2.1/resources/css/ext-all.css" rel="stylesheet" type="text/css" />
	<script type="text/javascript" src="<%=basePath %>ajaxFramework/ext-2.1/adapter/ext/ext-base.js"></script>
	<script type="text/javascript" src="<%=treePath %>ajaxFramework/ext-2.1/adapter/ext/ext-all.js"></script>
	<script type="text/javascript" src="<%=treePath %>ajaxFramework/ext-2.1/adapter/ext/ext-lang-zh_CN.js"></script>
	<script type="text/javascript" src="<%=basePath %>ajaxFramework/jQuery/jquery.js"></script>
	<script type="text/javascript" src="<%=basePath %>js/common/global/validator.js"></script>
	<script type="text/javascript" src="<%=basePath %>js/common/global/pageControl.js"></script>
	<script type="text/javascript" src="<%=basePath %>js/common/fileUpload/ajaxfileupload.js"></script>
	<script type="text/javascript" src="<%=basePath %>js/common/fileUpload/ajaxFileZx.js"></script>
	
	<script type="text/javascript" src="<%=treePath %>/ajaxLibrary/ext/init.js"></script>
	<script type="text/javascript" src="<%=treePath %>/js/system/userinfocheckedtree.js"></script>
	<script type="text/javascript">
		function peopleTree(){
			var win = userinfochecktree(<%=user.getUser_id() %>,document.getElementById('meetingPeopleId').value);
			win.show();
			win.on("winsubmint",function(data){
				document.getElementById('meetingPeopleId').value = data.usertext;
				win.hide();
			});
		}
	</script>
	<!-- 结束 -->
	
	<script type="text/javascript" src="<%=basePath %>js/My97DatePicker/WdatePicker.js"></script>
	<script type="text/javascript">
		function checkAllTextValid(form)  
		{  
		    //记录不含引号的文本框数量  
			var resultTag = 0;  
			//记录所有text文本框数量  
			var flag = 0;  
			for(var i = 0; i < form.elements.length; i ++)  
			{  
			 if(form.elements[i].type=="text")  
			 {  
			     flag = flag + 1;  
			  //此处填写所要过滤的特殊符号  
			  //注意：修改####处的字符，其它部分不许修改.  
			  //if(/^[^####]*$/.test(form.elements[i].value))  
			  if(/^[^\|"'<>]*$/.test(form.elements[i].value)) resultTag = resultTag+1;  
			  else form.elements[i].select();  
			 }  
			}
			//如果含引号的文本框等于全部文本框的值，则校验通过  
			if(resultTag == flag) return true;  
			else 
			{  
			 Ext.MessageBox.alert('提示框',"<nobr>文本框中不能含有<br/> 1 单引号: ' <br/> 2 双引号: \" <br/> 3 竖  杠: | <br/> 4 尖角号: < > <br/><br/>请检查输入！</nobr>");  
			 return false;  
			}  
		} 
		// 判断不能为空
		function submitform1(){
			// 判断不能有空格

	        var parten_str = /^\s*$/ ;
	        // 判断正整数

	        var parten_int=/^[0-9]*[0-9][0-9]*$/;
	        // 判断当前时间
	        var date = new Date();
	        
			if(document.form1.meetingName.value == null || document.form1.meetingName.value == ''){
				Ext.MessageBox.alert('提示框','<nobr>请填入会议名称</nobr>');
			}
			else if(parten_str.test(document.form1.meetingName.value)){
			    Ext.MessageBox.alert('提示框','<nobr>会议名称不能为空格</nobr>');
			}
			else if(document.form1.meetingName.value.length>20){
			    Ext.MessageBox.alert('提示框','<nobr>会议名称不能超过20个汉字</nobr>');
			}
			else if(document.form1.startDay.value == ''){
			    Ext.MessageBox.alert('提示框','<nobr>请填入会议开始时间</nobr>');
			}
			else if(document.form1.meetingPeopleId.value == ''  ){
			    Ext.MessageBox.alert('提示框','<nobr>请选择参会人</nobr>');
			}
			else if(document.form1.content.value != '' &&  document.form1.content.value.length>400){
			    Ext.MessageBox.alert('提示框','<nobr>内容不得大于400字</nobr>');
			}
			else{
	
				if(checkAllTextValid(document.form1))document.form1.submit();
			}
		}
		function back()
		{
			history.back(-1);
		}
		window.onload = function(){
			document.getElementById("right").style.height = document.body.clientHeight;
			document.getElementById("tableid").style.height = document.body.clientHeight-60;
			var tb = new Ext.Toolbar(
				{
					height:25
				}
			);
		
			tb.add(
		    {
		            text:'确定',
		            iconCls: 'daohang',
		        	handler: function(){
		        		submitform1();
					}
		    },
		    {
		            text:'取消',
		            iconCls: 'daohang',
		        	handler: function(){
		        		back();
					}
		    }
		    );
			tb.addFill();
		    tb.addText('<img id="windowResize" src="<%=basePath%>images/m_icon05.gif;"><a style="font-weight:bold; color:black;line-height: 22px;">会议修改</a>&nbsp;&nbsp;&nbsp;');
		    tb.render('menu');
		}
    </script>
	</head>
	<body>
		<div id="right">
			<div id="menu" style="padding-top:4px;"></div>
		<form action="<%=basePath%>tjsinfo/tjsoa/meetingroom/copyAgainUpdate.do" method="post" name="form1">
		<input type="hidden" name="roomEmpoly" id="roomEmpoly" value="<%=infos.getId() %>"/>
		<input type="hidden" name="node2" id="node2"/>
   	  	<input id="basePath" value="<%=basePath%>" type="hidden"/>
		<table width="100%" border="0" cellspacing="0" cellpadding="0" id="tableid">
          <tr>
            <td valign="top" height="100%">
               <div class="contabwd">
               		<table width="100%" height="400"border="0" cellspacing="0" cellpadding="0">
                          <tr>
                            <td width="90%">
                            	<table border="0" cellspacing="0" cellpadding="0" align="left" style="margin-top:10px; margin-left:20px">
                                  <tr>
                                    <td>
                                            <table border="0" align="left" cellpadding="0" cellspacing="0" class="ttaabb">
                                              <tr>
                                                <td width="25%" align="right"><img src="images/dfdf_03.gif" />&nbsp;会议名称:</td>
                                                <td width="65%"><input name="meetingName" value="<%=infos.getMeetingName() %>" type="text" size="41" style="border:1px #C0C0C0 solid;background:#F4F4F4; height:19px"/></td>
                                                <td width="10%">&nbsp;</td>
                                              </tr>
                                              <tr>
                                              <td width="25%" align="right"><img src="images/dfdf_03.gif" />&nbsp;请选择会议室:</td>
                                              <td>
                                              	<select name="selectPage" id="selectPage">
													<option value="<%=infos.getMeetingRoomMain().getId() %>">
														<%=infos.getMeetingRoomMain().getMeetingroomName() %>
													</option>
													<%
														for (Iterator iterator = roomList.iterator(); iterator.hasNext();) {
															MeetingRoomMain mrm = (MeetingRoomMain) iterator.next();
															if(!mrm.getId().equals(infos.getMeetingRoomMain().getId())){
													%>
														<option value="<%=mrm.getId() %>"><%=mrm.getMeetingroomName() %></option>
													<%
															}
														}
													%>
												</select>
												</td>
                                              </tr>
                                              <tr>
                                                <td align="right"><img src="images/dfdf_03.gif" />&nbsp;计划开始时间:</td>
                                                <td>
                                                <input type="text" id="startDay" name="startDay" onfocus="WdatePicker({dateFmt:'HH:mm'})" class="Wdate" value="<%=sdf.format(infos.getStartTime()) %>"/>
                                                </td>
                                                <td>&nbsp;</td>
                                              </tr>
                                              <tr>
													<td align="right">
														<img src="images/dfdf_03.gif" />
														&nbsp;持续时间:
													</td>
													<td>
														<select id="endtime" name="endtime">
															<option value="1" <%if("1".equals(infos.getEndTime()))out.print("selected"); %>>1</option>
															<option value="2" <%if("2".equals(infos.getEndTime()))out.print("selected"); %>>2</option>
															<option value="3" <%if("3".equals(infos.getEndTime()))out.print("selected"); %>>3</option>
															<option value="4" <%if("4".equals(infos.getEndTime()))out.print("selected"); %>>4</option>
															<option value="5" <%if("5".equals(infos.getEndTime()))out.print("selected"); %>>5</option>
															<option value="6" <%if("6".equals(infos.getEndTime()))out.print("selected"); %>>6</option>
															<option value="7" <%if("7".equals(infos.getEndTime()))out.print("selected"); %>>7</option>
															<option value="8" <%if("8".equals(infos.getEndTime()))out.print("selected"); %>>8</option>
															<option value="9" <%if("9".equals(infos.getEndTime()))out.print("selected"); %>>9</option>
															<option value="10" <%if("10".equals(infos.getEndTime()))out.print("selected"); %>>10</option>
														</select>小时
													</td>
													<td>
														&nbsp;
													</td>
												</tr>
												<tr>
													<td align="right">
														<img src="images/dfdf_03.gif" />
														&nbsp;会议时间段:
													</td>
													<td>
														<select id="remarks" name="remarks">
															<option value="上午" <%if("上午".equals(infos.getRemarks()))out.print("selected"); %>>上午</option>
															<option value="下午" <%if("下午".equals(infos.getRemarks()))out.print("selected"); %>>下午</option>
															<option value="全天" <%if("全天".equals(infos.getRemarks()))out.print("selected"); %>>全天</option>
														</select>
													</td>
													<td>
														&nbsp;
													</td>
												</tr>
                                              <tr>
                                                <td align="right"><img src="images/dfdf_03.gif" />&nbsp;参会人:</td>
                                                <td>
                                                	<a href="javascript:peopleTree();"><img src="images/icon100.gif" /></a>
                                                	<input type="hidden" name="meetingPeopleId" id="meetingPeopleId" value="<%=infos.getPeopleId() %>"/>
                                                </td>
                                                <td>
                                                </td>
                                              </tr>
                                              
                                              <tr>
                                                <td align="right"><img src="images/dfdf_03.gif" />&nbsp;内容:</td>
                                                <td><textarea name="content" cols="69" rows="10"><%=infos.getMeetingContent() %></textarea></td>
                                                <td>&nbsp;</td>
                                              </tr>
                                              <tr>
                                                <th colspan="3">&nbsp;</th>
                                              </tr>
                                            </table>
                                    </td>
                                  </tr>
                                </table>
                            </td>
                          </tr>
                     </table>
              </div>
            </td>
          </tr>
      </table>
      </form>
      </div>
	</body>
</html>